.chart-module {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Arial', sans-serif;
}

.chart-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  color: white;
}

.chart-title {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.draggable-chart {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.chart-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* 饼图样式 */
.pie-chart-container {
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.pie-chart {
  max-width: 100%;
  height: auto;
}

.pie-slice {
  cursor: pointer;
  transition: all 0.3s ease;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.pie-slice:hover,
.pie-slice.hovered {
  transform: scale(1.05);
  filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.5));
}

.pie-label {
  pointer-events: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.center-text,
.center-value {
  pointer-events: none;
}

/* 数据列表样式 */
.data-list {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.data-list h3 {
  margin: 0 0 20px 0;
  font-size: 1.5em;
  color: #ffd700;
}

.data-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.data-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 15px;
  cursor: move;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.data-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.data-item.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
  border-color: #ffd700;
}

.item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.color-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.item-name {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  padding: 8px 12px;
  color: white;
  font-size: 14px;
  flex: 1;
  min-width: 100px;
}

.item-name:focus {
  outline: none;
  border-color: #ffd700;
  background: rgba(255, 255, 255, 0.3);
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-value {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  padding: 8px 12px;
  color: white;
  font-size: 14px;
  width: 80px;
  text-align: center;
}

.item-value:focus {
  outline: none;
  border-color: #ffd700;
  background: rgba(255, 255, 255, 0.3);
}

.remove-btn {
  background: linear-gradient(45deg, #ff4757, #ff3838);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-btn:hover:not(:disabled) {
  background: linear-gradient(45deg, #ff3838, #ff2f2f);
  transform: scale(1.1);
}

.remove-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.drag-handle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  cursor: move;
  user-select: none;
  padding: 5px;
}

.drag-handle:hover {
  color: #ffd700;
}

.add-item-btn {
  background: linear-gradient(45deg, #2ed573, #17c0eb);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.add-item-btn:hover {
  background: linear-gradient(45deg, #17c0eb, #2ed573);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(46, 213, 115, 0.3);
}

/* 图例样式 */
.chart-legend {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.chart-legend h4 {
  margin: 0 0 15px 0;
  font-size: 1.3em;
  color: #ffd700;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.legend-name {
  flex: 1;
  font-size: 14px;
}

.legend-value {
  font-size: 14px;
  font-weight: bold;
  color: #ffd700;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .chart-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .pie-chart-container {
    order: -1;
  }
}

@media (max-width: 768px) {
  .chart-module {
    padding: 10px;
  }
  
  .chart-container {
    padding: 20px;
  }
  
  .chart-title {
    font-size: 2em;
  }
  
  .data-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .item-info {
    justify-content: space-between;
  }
  
  .item-controls {
    justify-content: space-between;
  }
  
  .item-name {
    min-width: auto;
  }
  
  .legend-items {
    grid-template-columns: 1fr;
  }
}

/* 拖拽动画 */
@keyframes dragStart {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.data-item[draggable="true"]:active {
  animation: dragStart 0.3s ease;
}

/* 输入框占位符样式 */
.item-name::placeholder,
.item-value::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* 滚动条样式 */
.data-items::-webkit-scrollbar {
  width: 6px;
}

.data-items::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.data-items::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.data-items::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}